define(function (require) {
    var zsApp = require('app');
    zsApp.controller( 'headerController',["$scope", "$http", "$state","$rootScope","$cookieStore", "$timeout",function( $scope,$http, $state,$rootScope,$cookieStore,$timeout){
//    	$scope.verifyCode = {};	
//    	zsApp.controller( 'headerController',["$scope","$http","$state","$stateParams",function($scope,$http,$state,$stateParams){
       	//用户登出
    	$rootScope.logout = function() {
    		$http
    		({		
    			url    : $scope.zsUrl+'digitalhome-boss/admin/pusers/logout',
    			method : 'GET',
    			//dataType:'JSONP',
    		}).then(function success(res) {	
    			console.log(res);	
    			var backUrl = res.data.back_url.toString();
    			if(undefined != res.data.back_url && backUrl == 'login')
				{
    				$state.go(backUrl,{},{cache: true});
//					$scope.getVerify();							
				}
    		},
    		function error(err){
    		});
    	}

	}]);
});